package cn.csq.cas;

import java.util.concurrent.atomic.AtomicInteger;

public class CASMainTest {

   static AtomicInteger atomicInteger = new AtomicInteger(1);
    static int i = 1;

    static class BizClass implements Runnable {

        @Override
        public void run() {
            atomicInteger.incrementAndGet();
        }
    }

    public static void main(String[] args) {
        new Thread(new BizClass()).start();
        new Thread(new BizClass()).start();
        int i = CASMainTest.atomicInteger.get();
        System.out.println("i = " + i);
    }
}
